import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    TouchableOpacity,
    StatusBar,
    SectionList,
} from 'react-native';

/**
 * 属性
 * th           上下文对象
 * title        标题
 */
export default class MyToolbarSimple extends Component {
    render() {
        return (
            <View>
                <StatusBar hidden={false} backgroundColor='#0e8586'/>
                <View style={[styles.navGroups, {marginTop: 22}]}>
                    <TouchableOpacity style={styles.scenes} onPress={(this.props.th).props.navigator.pop}>
                        <Text style={[styles.title, {marginLeft: 5, fontSize: 13}]}>&lt; 返回</Text>
                    </TouchableOpacity>
                    <View style={[styles.scenes, {alignItems: 'center'}]}>
                        <Text style={[styles.title, {fontSize: 16}]}>{this.props.title}</Text>
                    </View>
                    <View style={styles.scenes}></View>
                </View>
            </View>);
    }
}

var styles = StyleSheet.create({
    navGroups: {
        flexDirection: 'row',
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#fff',
        height: 50,
        paddingHorizontal: 5
    },
    scenes: {
        flex: 1
    },
    item: {
        padding: 10,
        fontSize: 18,
        height: 44,
    },
});

